package com.多线程07.demo04;

public class MyThread02 extends Thread {

    public MyThread02() {
    }

    public MyThread02(String name) {
        super(name);
    }

    @Override
    public void run() {
//        for (int i=0;i<100;i++){
//            System.out.println(i);
//        }
        System.out.println("run方法内线程名字+Thread.currentThread().getName:"+Thread.currentThread().getName());
        System.out.println("run方法内线程名字+getName:"+getName());
    }


    public static void main(String[] args) {
        MyThread02 mt02 = new MyThread02("飞机");
        MyThread02 mt03 = new MyThread02("坦克");

        mt02.start();
        mt03.start();


        //返回值：当前正在执行的线程的名字
//        System.out.println("线程名字"+Thread.currentThread().getName());
    }

}
